package com.ys.controller.api.outer;

import com.ys.entity.base.TbFileInfo;
import com.ys.entity.storage.TccFbaBoxUp;
import com.ys.entity.storage.TccFbaPlan;
import com.ys.service.business.TbFileInfoService;
import com.ys.service.storage.FbaInboundApiService;
import com.ys.service.storage.TccFbaBoxUpService;
import com.ys.vo.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
@RequestMapping("/api/outer/apiOuterDemoLzmFileTest")
public class ApiOuterDemoLzmFileTestController {

    private static final Logger logger = LoggerFactory.getLogger(ApiOuterDemoLzmFileTestController.class);

	@Autowired
	private TbFileInfoService tbFileInfoService;


	@RequestMapping("/test1")
	@ResponseBody
	public R test1(HttpServletRequest request, HttpServletResponse response
	) {
		try {
			logger.info("***********开始***********");
			List< TbFileInfo > fileList = new TbFileInfo().setSourceCode("graduationCertificate").queryList();
			tbFileInfoService.downLoadFileBatch(fileList,request,response,"aaaaa");


			logger.info("***********完成***********");
			return R.ok();
		}catch (Exception e){
			logger.error("操作失败：",e.getMessage(),e);
			return R.error("操作失败!");
		}
	}



}
